﻿@model IEnumerable<CashFlow.Entities.Models.BillListModel>

@{
	ViewBag.Title = "Index";
		Layout = "~/Views/Shared/_Layout.cshtml";
}

@section TitleContent 
{
	Bill List
	}

@section HeadContent
{
	<link href="../../Content/Bill/BillList.css" rel="stylesheet" type="text/css" />
	<script src="../../Scripts/Bill/billList.js" type="text/javascript"></script>
}

@section NavigationContent	
{	
	<div>
		@Html.ActionLink("Create New Bill", "Add")
	</div>	
}

<h2>My bills</h2>
<div class="undoDelete">
	Bill deleted&nbsp;
	<a href="#" id='undo' billId=''>Undo</a>
</div>
<div id="dataContainer">
@if (Model != null && Model.Count() > 0) {
	<table class="billListTable">
		<tr>
			<th>Description</th>
			<th>Repeat</th>
			<th>Amount</th>
			<th>&nbsp;</th>
		</tr>
		@foreach (var item in Model) {
			<tr>
				<td>@Html.ActionLink(item.PayeeName, "Edit", new { id = item.Id })</td>
				<td class="repeatCol">@item.Recurrence</td>
				<td class="amountCol">@item.Amount</td>
				<td class="deleteCol">
					<a href="#" class="deleteButton" billId='@item.Id'>
						<span class="ui-icon ui-icon-trash"></span>
					</a>
				</td>
			</tr>
		}
	</table>
} else {
	@Html.Label("You don't have any bills yet")
}
</div>
